package com.ssy.wireless.web.vo.req;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by cofey on 16/11/20.
 */
public class ApDeviceQueryVo {
    private Long hotspotType;
    private Long hotspotId;
    private String apIndex;
    private String joinBeginTime;
    private String joinEndTime;

    public Long getHotspotType() {
        return hotspotType;
    }

    public void setHotspotType(Long hotspotType) {
        this.hotspotType = hotspotType;
    }

    public String getApIndex() {
        return apIndex;
    }

    public void setApIndex(String apIndex) {
        this.apIndex = apIndex;
    }

    public String getJoinBeginTime() {
        return joinBeginTime;
    }

    public void setJoinBeginTime(String joinBeginTime) {
        this.joinBeginTime = joinBeginTime;
    }

    public String getJoinEndTime() {
        return joinEndTime;
    }

    public void setJoinEndTime(String joinEndTime) {
        this.joinEndTime = joinEndTime;
    }

    public Long getHotspotId() {
        return hotspotId;
    }

    public void setHotspotId(Long hotspotId) {
        this.hotspotId = hotspotId;
    }

    public Map<String, Object> queryParams() {
        Map<String, Object> params = new HashMap();
        params.put("hotspotId", this.getHotspotId());
        params.put("hotspotType", null != this.getHotspotType() && this.getHotspotType().intValue() > 0 ? this.getHotspotType() : null);
        params.put("apIndex", StringUtils.hasLength(this.getApIndex()) ? "%" + this.getApIndex() + "%" : null);
        params.put("joinBeginTime", StringUtils.hasLength(this.getJoinBeginTime()) ? this.getJoinBeginTime() + " 00:00:00" : null);
        params.put("joinEndTime", StringUtils.hasLength(this.getJoinEndTime()) ? this.getJoinEndTime() + " 23:59:59" : null);
        return params;
    }
}
